Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Printing Extensions and Drivers /
Chapter 3 - Printer Drivers / The QuickDraw GX ImageWriter II Printer Driver Messages


Rendering the Page on the Printing Device

QuickDraw GX sends the GXRenderPage message once for each page, when the QuickDraw GX shape that is the picture of the page needs to be translated into a stream of data that the printing device can use to render the output page. QuickDraw GX's default implementation for this function handles most of the work for you. For a raster printing device, it converts the page into bitmap data and sends the GXRasterPackageBitmap message before sending the bitmap to the printing device. When the raster printing-device head has to be moved down the page, QuickDraw GX sends the GXRasterLineFeed message.

Printing is accomplished by adding bytes of data to a buffer that you send to the printing device with the GXBufferData message.

The ImageWriter II printer driver overrides the GXRenderPage message to add its own operations. Its override function, SD_RenderPage, determines if the page is to be printed in text mode or not. If so, it calls the local function PrintPageInDraftMode to do the printing. If the page is printed in graphics mode, SD_RenderPage sends escape sequences to the printing device to set up the page size and then forwards the GXRenderPage message so that the default implementation can manage the page printing. The GXRenderPage message is described on page 4-96 in the chapter "Printing Messages."

The ImageWriter II printer driver overrides the GXRasterLineFeed message with the SD_LineFeed function. This function adjusts the line-feed size if the driver is printing at low resolution because the ImageWriter II assumes that line-feed commands are expressed in high-resolution values. SD_LineFeed forwards the GXRasterLineFeed message to allow the default implementation to send the appropriate escape sequences to the printing device. The GXRasterLineFeed message is described on page 4-98 in the chapter "Printing Messages."

The ImageWriter II printer driver also overrides the GXRasterPackageBitmap message. The SD_PackageBitmap override function fills in a buffer with the
raster data, applying ImageWriter II run-length encoding and rotating the data.
The GXRasterPackageBitmap message is described on page 4-100 in the chapter "Printing Messages."

The SD_RenderPage, SD_LineFeed, and SD_PackageBitmap override functions are shown in the QuickDraw GX sample code.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help